package com.xingmang.common.constant;

import com.xingmang.common.enums.ResultCode;

/**
 * @auther: hansom
 * @Version: 1.0
 * @create 2023/4/21 10:35
 */
public class ResponseData {
    public static <T> ResultBean<T> success(T data){
        return new ResultBean<>(ResultCode.SUCCESS,data);
    }
    public static <T> ResultBean<T> error(ResultCode code){
        return new ResultBean<>(code,null);
    }
    public static <T> ResultBean<T> error(String msg){
        return new ResultBean<>(ResultCode.FAIL.getCode(),msg,null);
    }
}
